package com.htjx.mall.admin.controllers.converters;

import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils;

public class StringToLongConverter implements Converter<String, Long> {

	@Override
	public Long convert(String source) {
		if (!StringUtils.hasText(source)) {
			return 0L;
		} else {
			return Long.parseLong(source);
		}
	}
}
